package com.taoxue.minmssh.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.taoxue.minmssh.model.Twork;
import com.taoxue.minmssh.service.IWorkService;

@Controller
public class WorkController {

	private IWorkService workService;

	public IWorkService getWorkService() {
		return workService;
	}

	@Resource(name = "workService")
	public void setWorkService(IWorkService workService) {
		this.workService = workService;
	}

	@RequestMapping("/spring/save")
	public String save() {
		Twork work = new Twork();
		work.setCategory("家教");
		work.setName("小学六年级英语");
		work.setTotal(10);
		workService.save(work);
		return "/index";
	}

}
